package com.whuan.lambda;

public class lambda5 {
    public static void main(String[] argv) {
        engine((x,y)-> x + y,1,2);
        engine((x,y)-> x * y,1,3);
        engine((x,y)-> x / y,1,4);
        engine((x,y)-> x % y,1,5);
    }
    private static void engine(Calculator calculator,int x,int y){
        int result = calculator.calculate(x,y);
        System.out.println(result);
    }
}
@FunctionalInterface
interface Calculator{
    int calculate(int x, int y);
}
